#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <functional>
using namespace std;

bool compare(int a, int b)
{
    return a < b;
}

void print(int it)
{
    cout << it << " ";
}

int main()
{
    int a = 100;
    int b = 200;
    vector<int> v;
    v.push_back(a);
    v.push_back(b);
    v.push_back(150);

    // sort(v.begin(),v.end(),compare);
    // using namespace placeholders;
    sort(v.begin(), v.end(), std::bind(compare, placeholders::_1, placeholders::_2));

    for_each(v.begin(), v.end(), print);
    cout << endl;

    for_each(v.begin(), v.end(), [](int it)
             { cout << it << " "; });

    return 0;
}